<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="en" name="language">
	<title>resource</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link media="screen" href="../docutils-api.css" type="text/css" rel="stylesheet">

</head>

<body>

<div class="banner">
<img src="../images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
  <input type="hidden" name="domains" value="www.graphicsmagick.org" />
  <input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" />&nbsp;<input type="submit" name="sa" value="Search" /></span>
</form>
</div>


<div class="navmenu">
<ul>
  <li><a href="../index.html">Home</a></li>
  <li><a href="../project.html">Project</a></li>
  <li><a href="../download.html">Download</a></li>
  <li><a href="../README.html">Install</a></li>
  <li><a href="../Hg.html">Source</a></li>
  <li><a href="../NEWS.html">News</a> </li>
  <li><a href="../utilities.html">Utilities</a></li>
  <li><a href="../programming.html">Programming</a></li>
  <li><a href="../reference.html">Reference</a></li>
</ul>
</div>

<main id="resource">
<h1 class="title">resource</h1>
<p class="subtitle" id="set-resource-consumption-limits-e-g-memory">Set resource consumption limits (e.g. memory)</p>
<div class="contents topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#acquiremagickresource" id="id11">AcquireMagickResource</a></p></li>
<li><p><a class="reference internal" href="#getmagickresource" id="id12">GetMagickResource</a></p></li>
<li><p><a class="reference internal" href="#getmagickresourcelimit" id="id13">GetMagickResourceLimit</a></p></li>
<li><p><a class="reference internal" href="#liberatemagickresource" id="id14">LiberateMagickResource</a></p></li>
<li><p><a class="reference internal" href="#listmagickresourceinfo" id="id15">ListMagickResourceInfo</a></p></li>
<li><p><a class="reference internal" href="#setmagickresourcelimit" id="id16">SetMagickResourceLimit</a></p></li>
</ul>
</div>
<section id="acquiremagickresource">
<h1><a class="toc-backref" href="#id11">AcquireMagickResource</a></h1>
<section id="synopsis">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail AcquireMagickResource( const <a class="reference external" href="../api/types.html#resourcetype">ResourceType</a> type, const magick_int64_t size );</pre>
</section>
<section id="description">
<h2>Description</h2>
<p>AcquireMagickResource() acquires resources of the specified type.  True is
returned if the specified resource is available otherwise False.</p>
<p>The format of the AcquireMagickResource() method is:</p>
<pre class="literal-block">MagickPassFail AcquireMagickResource( const <a class="reference external" href="../api/types.html#resourcetype">ResourceType</a> type, const magick_int64_t size );</pre>
<dl class="simple">
<dt>type:</dt>
<dd><p>The type of resource.</p>
</dd>
<dt>size:</dt>
<dd><p>The number of bytes needed from for this resource.</p>
</dd>
</dl>
</section>
</section>
<section id="getmagickresource">
<h1><a class="toc-backref" href="#id12">GetMagickResource</a></h1>
<section id="id1">
<h2>Synopsis</h2>
<pre class="literal-block">magick_uint64_t GetMagickResource( const <a class="reference external" href="../api/types.html#resourcetype">ResourceType</a> type );</pre>
</section>
<section id="id2">
<h2>Description</h2>
<p>GetMagickResource() returns the current consumption level for the
specified resource type.</p>
<p>The format of the GetMagickResource() method is:</p>
<pre class="literal-block">magick_uint64_t GetMagickResource( const <a class="reference external" href="../api/types.html#resourcetype">ResourceType</a> type );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>type:</dt>
<dd><p>The type of resource.</p>
</dd>
</dl>
</section>
</section>
<section id="getmagickresourcelimit">
<h1><a class="toc-backref" href="#id13">GetMagickResourceLimit</a></h1>
<section id="id3">
<h2>Synopsis</h2>
<pre class="literal-block">magick_int64_t GetMagickResourceLimit( const <a class="reference external" href="../api/types.html#resourcetype">ResourceType</a> type );</pre>
</section>
<section id="id4">
<h2>Description</h2>
<p>GetMagickResourceLimit() returns the current maximum limit for the
specified resource type.  Returns a maximum 64-bit integer value if
the resource has not been limited.</p>
<p>The format of the GetMagickResourceLimit() method is:</p>
<pre class="literal-block">magick_int64_t GetMagickResourceLimit( const <a class="reference external" href="../api/types.html#resourcetype">ResourceType</a> type );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>type:</dt>
<dd><p>The type of resource.</p>
</dd>
</dl>
</section>
</section>
<section id="liberatemagickresource">
<h1><a class="toc-backref" href="#id14">LiberateMagickResource</a></h1>
<section id="id5">
<h2>Synopsis</h2>
<pre class="literal-block">void LiberateMagickResource( const <a class="reference external" href="../api/types.html#resourcetype">ResourceType</a> type, const magick_int64_t size );</pre>
</section>
<section id="id6">
<h2>Description</h2>
<p>LiberateMagickResource() liberates resources of the specified type.</p>
<p>The format of the LiberateMagickResource() method is:</p>
<pre class="literal-block">void LiberateMagickResource( const <a class="reference external" href="../api/types.html#resourcetype">ResourceType</a> type, const magick_int64_t size );</pre>
<dl class="simple">
<dt>type:</dt>
<dd><p>The type of resource.</p>
</dd>
<dt>size:</dt>
<dd><p>The size of the resource.</p>
</dd>
</dl>
</section>
</section>
<section id="listmagickresourceinfo">
<h1><a class="toc-backref" href="#id15">ListMagickResourceInfo</a></h1>
<section id="id7">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int ListMagickResourceInfo( FILE *file, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="id8">
<h2>Description</h2>
<p>Method ListMagickResourceInfo lists the resource info to a file.</p>
<p>The format of the ListMagickResourceInfo method is:</p>
<pre class="literal-block">unsigned int ListMagickResourceInfo( FILE *file, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<p>A description of each parameter follows.</p>
<dl class="simple">
<dt>file:</dt>
<dd><p>An pointer to a FILE.</p>
</dd>
<dt>exception:</dt>
<dd><p>Return any errors or warnings in this structure.</p>
</dd>
</dl>
</section>
</section>
<section id="setmagickresourcelimit">
<h1><a class="toc-backref" href="#id16">SetMagickResourceLimit</a></h1>
<section id="id9">
<h2>Synopsis</h2>
<pre class="literal-block">void SetMagickResourceLimit( const <a class="reference external" href="../api/types.html#resourcetype">ResourceType</a> type, const unsigned long limit );</pre>
</section>
<section id="id10">
<h2>Description</h2>
<p>SetMagickResourceLimit() sets the limit for a particular resource.  The
units for resource types are as follows:</p>
<p>DiskResource    -- Bytes
FileResource    -- Open files
MapResource     -- Bytes
MemoryResource  -- Bytes
PixelsResource  -- Pixels
ThreadsResource -- Threads
WidthResource   -- Pixels
HeightResource  -- Pixels
ReadResource    -- Bytes
WriteResource   -- Bytes</p>
<p>The format of the SetMagickResourceLimit() method is:</p>
<pre class="literal-block">void SetMagickResourceLimit( const <a class="reference external" href="../api/types.html#resourcetype">ResourceType</a> type, const unsigned long limit );</pre>
<dl class="simple">
<dt>type:</dt>
<dd><p>The type of resource.</p>
</dd>
<dt>limit:</dt>
<dd><p>The maximum limit for the resource.</p>
</dd>
</dl>
</section>
</section>
</main>


<hr class="docutils">
<div class="document">
    <p><a href="../Copyright.html">Copyright</a> © GraphicsMagick Group 2002-2025<!--SPONSOR_LOGO--></p>
</div>

</main>
</body>
</html>
